package com.hinnotek.amoeba.ui.activity.old

import android.os.Bundle
import android.view.*
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.lee.common.base.BaseActivity
import com.hinnotek.amoeba.R
import com.hinnotek.amoeba.adapters.old.ProjectRequirementsDetailAdapter
import com.hinnotek.amoeba.databinding.ActivityProjectRequirementsDetailsBinding
import com.hinnotek.amoeba.utilities.IntentUtils
import java.util.*


class ProjectRequirementsDetailsActivity : BaseActivity<ActivityProjectRequirementsDetailsBinding>() {

    private var mAdapter: ProjectRequirementsDetailAdapter? = null
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setLeftVisible(true)
        setTitle("项目需料详情")

        setContentView(R.layout.activity_project_requirements_details)
    }

    override fun initVew() {
        val manager = LinearLayoutManager(this)
        manager.orientation = RecyclerView.VERTICAL
        bindingView.rlv.layoutManager = manager
        bindingView.rlv.adapter = ProjectRequirementsDetailAdapter().also { mAdapter = it }
        mAdapter?.setOnItemClickListener { _: BaseQuickAdapter<*, *>?, _: View?, _: Int ->
            IntentUtils.startActivity(
                this,
                PurchaseRequisitionActivity::class.java
            )
        }
    }

    override fun setData() {
        val stringList: MutableList<String> = ArrayList()
        for (i in 0..9) {
            stringList.add("")
        }
        mAdapter?.setList(stringList)
    }
}